﻿using System;
using System.Collections.Generic;

namespace MiniStock.Entities.Common
{
    public class SerializationHelper
    {
        public static readonly List<Type> KnownEntityTypes = new List<Type>();
        public static readonly List<Type> KnownEventTypes = new List<Type>();

        public static void RegisterKnownEventTypes(IEnumerable<Type> list)
        {
            foreach(var t in list)
            {
                if(!KnownEventTypes.Exists(i => i.FullName == t.FullName))
                    KnownEventTypes.Add(t);
            }
        }

        public static void RegisterKnownEntityTypes(IEnumerable<Type> list)
        {
            foreach (var t in list)
            {
                if (!KnownEntityTypes.Exists(i => i.FullName == t.FullName))
                    KnownEntityTypes.Add(t);
            }
        }
    }
}
